<div th:fragment="desk-header">
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
  <meta name="description" content="">
  <meta name="author" content="">
  <link rel="icon" th:href="@{/favicon.ico}">

  <title>Dashboard Template for Bootstrap</title>

  <!-- Bootstrap core CSS -->
  <link th:href="@{/dist/css/bootstrap.min.css}" rel="stylesheet">

  <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
  <link th:href="@{/assets/css/ie10-viewport-bug-workaround.css}" rel="stylesheet">

  <!-- Custom styles for this template -->
  <link th:href="@{/css/dashboard.css}" rel="stylesheet">

  <!-- Just for debugging purposes. Don't actually copy these 2 lines! -->
  <!--[if lt IE 9]><script th:src="@{/assets/js/ie8-responsive-file-warning.js}"></script><![endif]-->
  <script th:src="@{/assets/js/ie-emulation-modes-warning.js}"></script>

  <link th:href="@{/component/table/css/bootstrap-table.min.css}" rel="stylesheet">
  <link th:href="@{/component/table/css/bootstrap-table-page-jump-to.min.css}" rel="stylesheet">
</div>

<div th:fragment="desk-top">
  <nav class="navbar navbar-inverse navbar-fixed-top">
    <div class="container-fluid">
      <div class="navbar-header">
        <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
          <span class="sr-only">Toggle navigation</span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
        </button>
        <a class="navbar-brand" href="#">Project name</a>
      </div>
      <div id="navbar" class="navbar-collapse collapse">
        <ul class="nav navbar-nav navbar-right">
          <li><a href="#" th:text="${userAccount}"></a></li>
          <li><a href="javascript:logout();" >logout</a></li>
        </ul>
      </div>
    </div>
  </nav>
</div>


<div th:fragment="desk-menu">
        <div class="col-sm-3 col-md-2 sidebar">
          <ul class="nav nav-sidebar">
            <li class="active" th:if="${'user-index'==tag_mb}"><a href="/user/index">个人中心</a></li>
            <li th:if="${'user-index'!=tag_mb}"><a href="/user/index">个人中心</a></li>

            <shiro:hasRole name="admin">
            <li class="active" th:if="${'admin-user'==tag_mb}"><a href="/admin/user">用户列表 <span class="sr-only">(current)</span></a></li>
            <li th:if="${'admin-user'!=tag_mb}"><a href="/admin/user">用户列表</a></li>
            </shiro:hasRole>

            <li class="active" th:if="${'result-index'==tag_mb}"><a href="/result/index">网络数据列表</a></li>
            <li th:if="${'result-index'!=tag_mb}"><a href="/result/index">网络数据列表</a></li>

            <li class="active" th:if="${'sites-index'==tag_mb}"><a href="/sites/index">数据源列表</a></li>
            <li th:if="${'sites-index'!=tag_mb}"><a href="/sites/index">数据源列表</a></li>

            <li class="active" th:if="${'sites-edit'==tag_mb}"><a href="/sites/edit">新增数据源</a></li>
            <li th:if="${'sites-edit'!=tag_mb}"><a href="/sites/edit">新增数据源</a></li>
          </ul>
          <ul class="nav nav-sidebar" style="display: none">
            <li><a href="">Nav item</a></li>
            <li><a href="">Nav item again</a></li>
            <li><a href="">One more nav</a></li>
            <li><a href="">Another nav item</a></li>
            <li><a href="">More navigation</a></li>
          </ul>
          <ul class="nav nav-sidebar" style="display: none">
            <li><a href="">Nav item again</a></li>
            <li><a href="">One more nav</a></li>
            <li><a href="">Another nav item</a></li>
          </ul>
        </div>
</div>


<div th:fragment="desk-footer">
  <script th:src="@{/js/jquery/jquery-3.4.1.min.js}"></script>
  <script th:src="@{/js/layer/layer.min.js}"></script>
  <script th:src="@{/dist/js/bootstrap.min.js}"></script>
  <!-- Just to make our placeholder images work. Don't actually copy the next line! -->
  <script th:src="@{/assets/js/vendor/holder.min.js}"></script>
  <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
  <script th:src="@{/assets/js/ie10-viewport-bug-workaround.js}"></script>
  <script type="text/javascript" th:src="@{/component/table/js/bootstrap-table.min.js}"></script>
  <script type="text/javascript" th:src="@{/component/table/js/bootstrap-table-zh-CN.min.js}"></script>
  <script type="text/javascript" th:src="@{/component/table/js/bootstrap-table-page-jump-to.min.js}"></script>
  <script>
    function logout(){
      layer.confirm('是否退出登录？', {
        btn: ['确定', '关闭'] //按钮
      }, function(){
        location.href="/user/logout";
      });
    }
  </script>

</div>